package demo;

import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int flag = 0;
        for (int i = 0; i < n; i++) {
            String val = scanner.next();
            if(val.equals("zhen")) flag = 0;
            else flag++;
            if(flag==2&&i!=n-1){
                System.out.println("No");
                return ;
            }
        }
        System.out.println("Yes");
    }
}




